package com.gitee.fanx.rpc.dto;

import java.util.StringJoiner;

/**
 * 分页请求
 *
 * @author fanhang
 */
public class PageRequest {
    private Integer pageNum;
    private Integer pageSize;

    public PageRequest() {
    }

    private PageRequest(Integer pageNum, Integer pageSize) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }

    public static PageRequest of(Integer pageNum, Integer pageSize) {
        return new PageRequest(pageNum, pageSize);
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", PageRequest.class.getSimpleName() + "[", "]")
            .add("pageNum=" + pageNum)
            .add("pageSize=" + pageSize)
            .toString();
    }
}

